package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(name="service-product",fallback = DegradeProductFeignClient.class)
public interface ProductFeignClient {
    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);
    //2.一二三级分类
    @GetMapping("/api/product/inner/getBaseCategoryView/{category3Id}")
    public BaseCategoryView getBaseCategoryView(@PathVariable Long category3Id);
    //3.销售属性及值及选中红边框
    @GetMapping("/api/product/inner/getSpuSaleAttrValueChecked/{skuId}/{spuId}")
    public List<SpuSaleAttr> getSpuSaleAttrValueChecked(@PathVariable Long skuId,
                                                        @PathVariable Long spuId);
    //4.销售属性值组合对应的skuId
    @GetMapping("/api/product/inner/getValueSkuJson/{spuId}")
    public Map getValueSkuJson(@PathVariable Long spuId);
    //5.单独查询价格
    @GetMapping("/api/product/inner/getPrice/{skuId}")
    public BigDecimal getPrice(@PathVariable Long skuId);
    //查询三级分类视图集合
    @GetMapping("/api/product/inner/getBaseCategoryViewList")
    public List<BaseCategoryView>getBaseCategoryViewList();
    //根据主键查询品牌对象
    @GetMapping("/api/product/inner/getBaseTrademark/{id}")
    public BaseTrademark getBaseTrademark(@PathVariable Long id);
   //查询ES索引库所需要的平台属性ID及名称及值
    @GetMapping("/api/product/inner/getSkuAttrValue/{skuId}")
    public List<SkuAttrValue>getSkuAttrValue(@PathVariable Long skuId);
}
